<!-- INCLUDE sv_overall_header.html -->
<script type="text/javascript">
var loading = false;
var done	= false;

$(document).ready(function()
{
	function get_more_data() 
	{ 
		//alert('get more data');
		
		
		
		<!-- IF S_MODE == '1_month_roi' -->		
		var qstr="full_ranking.php?mode=get_more_data_for_roi&month=1&last_ranking=";
		<!-- ELSEIF S_MODE == '3_month_roi' -->		
		var qstr="full_ranking.php?mode=get_more_data_for_roi&month=3&last_ranking=";
		<!-- ELSEIF S_MODE == '6_month_roi' -->		
		var qstr="full_ranking.php?mode=get_more_data_for_roi&month=6&last_ranking=";
		<!-- ELSEIF S_MODE == '12_month_roi' -->		
		var qstr="full_ranking.php?mode=get_more_data_for_roi&month=12&last_ranking=";
		<!-- ELSEIF S_MODE == '2_year_roi' -->		
		var qstr="full_ranking.php?mode=get_more_data_for_roi&month=24&last_ranking=";
		<!-- ELSEIF S_MODE == '3_year_roi' -->		
		var qstr="full_ranking.php?mode=get_more_data_for_roi&month=36&last_ranking=";
		<!-- ELSEIF S_MODE == '4_year_roi' -->		
		var qstr="full_ranking.php?mode=get_more_data_for_roi&month=48&last_ranking=";
		<!-- ELSE  -->
		var qstr="full_ranking.php?mode=get_more_data&last_ranking=";
		<!-- ENDIF -->
		
		var ID=$(".ranking_row:last").attr("id");
		
		$('div#last_msg_loader').html('<img src="{S_PHPBB_ROOT_PATH}/images/loading.gif">');
		$.post(
			qstr+ID,	
			function(data)
			{
				//alert('get data back ');
				if (data != "") 
				{
					$(".ranking_row:last").after(data); 
				}
				else
				{
					// no more data available.
					$('div#last_msg_loader').empty();	
					done = true;
				}
				
				$('div#last_msg_loader').empty();
				
				loading = false;
			}
		);
		
		loading = true;
	}; 
	
	$(window).scroll(
		function()
		{			
			//alert('scroll ');
			//var	str = 'scrollTop:' + $(window).scrollTop() + ' doc height:' + $(document).height() + ' win height:' +  $(window).height();
			//alert(str);
			
			// add 5 pixel for safe margin
			if ($(window).scrollTop() + 5 >= $(document).height() - $(window).height() && loading == false && done == false)
			{
				get_more_data();
			}
		}
	); 
});

</script>



<div class="panel" style="float:left;margin-right:1em;"> 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>
		<!-- IF S_MODE == '1_month_roi' -->		
		{L_SV_ROI_RANKING_LAST_1_MONTH}
		<!-- ELSEIF S_MODE == '3_month_roi' -->		
		{L_SV_ROI_RANKING_LAST_3_MONTH}
		<!-- ELSEIF S_MODE == '6_month_roi' -->		
		{L_SV_ROI_RANKING_LAST_6_MONTH}
		<!-- ELSEIF S_MODE == '12_month_roi' -->		
		{L_SV_ROI_RANKING_LAST_12_MONTH}
		<!-- ELSEIF S_MODE == '2_year_roi' -->		
		{L_SV_ROI_RANKING_LAST_2_YEAR}
		<!-- ELSEIF S_MODE == '3_year_roi' -->		
		{L_SV_ROI_RANKING_LAST_3_YEAR}
		<!-- ELSEIF S_MODE == '4_year_roi' -->		
		{L_SV_ROI_RANKING_LAST_4_YEAR}
		<!-- ELSE  -->
		{L_SV_MARKET_VALUE_RANKING}  
		<!-- ENDIF -->
	
		&nbsp <img title="{L_SV_FULL_RANKING_TITLE_TIPS}" src="{T_IMAGES_PATH}icons/smile/info.gif" alt="info" /> 
	</h2> 
	
	</div>
	<table border="0" cellpadding="5" cellspacing="5">
		<tr>
			<td><p>{L_SV_RANK_INDEX}</p></td>
			
			<td></td>
			
			<td><p>{L_SV_USER_NAME}</p></td>
			<td width=120px><p <!-- IF S_MODE == 'user_value' --> style="font-weight:bold;"<!-- ENDIF -->>{L_SV_MARKET_VALUE}</p></td>
			<td><p  <!-- IF S_MODE == '1_month_roi' --> style="font-weight:bold;"<!-- ENDIF -->	>{L_SV_ROI_LAST_1_MONTH}</p></td>
			<td><p  <!-- IF S_MODE == '3_month_roi' --> style="font-weight:bold;"<!-- ENDIF --> >{L_SV_ROI_LAST_3_MONTH}</p></td>
			<td><p  <!-- IF S_MODE == '6_month_roi' --> style="font-weight:bold;"<!-- ENDIF --> >{L_SV_ROI_LAST_6_MONTH} </p></td>
			<td><p  <!-- IF S_MODE == '12_month_roi' --> style="font-weight:bold;"<!-- ENDIF --> >{L_SV_ROI_LAST_12_MONTH}</p></td>
			<td><p  <!-- IF S_MODE == '2_year_roi' --> style="font-weight:bold;"<!-- ENDIF --> >{L_SV_ROI_LAST_2_YEAR}</p></td>
			<td><p  <!-- IF S_MODE == '3_year_roi' --> style="font-weight:bold;"<!-- ENDIF --> >{L_SV_ROI_LAST_3_YEAR}</p></td>
			<td><p  <!-- IF S_MODE == '4_year_roi' --> style="font-weight:bold;"<!-- ENDIF --> >{L_SV_ROI_LAST_4_YEAR}</p></td>
			
		</tr>
		<!-- BEGIN list -->
		
		<tr id="{list.INDEX}" class="ranking_row" > 	
			<td><p>{list.INDEX}</p></td>
			<td height="36">
				<a href="{S_QUERY_USER}&user_id={list.USER_ID}">
					<!-- IF list.USER_FB_ID != 0 -->
					<img src="http://graph.facebook.com/{list.USER_FB_ID}/picture" width=32 height=32>
					<!-- ELSE -->
					<div style="width: 32px; height: 32px; background: #ECF1F3; border: 0px;">&nbsp;</div>
					<!-- ENDIF -->
				</a>
			</td>		
			<td><p><a href="{S_QUERY_USER}&user_id={list.USER_ID}">{list.USER_NAME}</a></p></td>
			<td><p <!-- IF S_MODE == 'user_value' --> style="font-weight:bold;"<!-- ENDIF -->   >{list.VALUE}</p></td>
			<td><p <!-- IF S_MODE == '1_month_roi' --> style="font-weight:bold;"<!-- ENDIF -->  ><!-- IF list.HAVE_ROI_30 == true -->{list.ROI_30}% <!-- ELSE --> <!-- ENDIF --></p></td>
			<td><p <!-- IF S_MODE == '3_month_roi' --> style="font-weight:bold;"<!-- ENDIF -->	><!-- IF list.HAVE_ROI_90 == true -->{list.ROI_90}% <!-- ELSE --> <!-- ENDIF --></p></td>
			<td><p <!-- IF S_MODE == '6_month_roi' --> style="font-weight:bold;"<!-- ENDIF -->	><!-- IF list.HAVE_ROI_180 == true -->{list.ROI_180}% <!-- ELSE --> <!-- ENDIF --></p></td>
			<td><p <!-- IF S_MODE == '12_month_roi' --> style="font-weight:bold;"<!-- ENDIF -->	><!-- IF list.HAVE_ROI_360 == true -->{list.ROI_360}% <!-- ELSE --> <!-- ENDIF --></p></td>
			<td><p <!-- IF S_MODE == '2_year_roi' --> style="font-weight:bold;"<!-- ENDIF -->	><!-- IF list.HAVE_ROI_720 == true -->{list.ROI_720}% <!-- ELSE --> <!-- ENDIF --></p></td>
			<td><p <!-- IF S_MODE == '3_year_roi' --> style="font-weight:bold;"<!-- ENDIF -->	><!-- IF list.HAVE_ROI_1080 == true -->{list.ROI_1080}% <!-- ELSE --> <!-- ENDIF --></p></td>
			<td><p <!-- IF S_MODE == '4_year_roi' --> style="font-weight:bold;"<!-- ENDIF -->	><!-- IF list.HAVE_ROI_1440 == true -->{list.ROI_1440}% <!-- ELSE --> <!-- ENDIF --></p></td>
			
			
		</tr>
		
		<!-- END list -->
		
		
		
	</table>
	<div id="last_msg_loader"></div>
</div>





<!-- INCLUDE sv_overall_footer.html -->